<div id="accordion2" class="accordion">
    <?php $args = array('post_type' => 'faq', 'nopaging' => true);
    $query = new WP_Query($args);
    while ($query->have_posts()){
        $query->the_post();
        $fields = get_post_custom(); ?>
        <div class="accordion-group">
            <div class="accordion-heading">
                <a data-parent="#accordion2" data-toggle="collapse"
                   class="accordion-toggle collapsed"
                   href="#collapse<?php the_ID(); ?>"><?php the_title(); ?></a>
            </div>
            <div class="accordion-body collapse" id="collapse<?php the_ID(); ?>" style="height:0px">
                <div class="accordion-inner">
                    <?php echo $fields['answer'][0]; ?>
                </div>
            </div>
        </div>
    <?php } ?>
</div>